#ifndef DATASERVER_H_
#define DATASERVER_H_

#include "mpi.h"

class DataServer {
public:
    virtual void start();
    virtual void stop() { isServingData = false; }
    
    DataServer() {
        isServingData = true;
    }
    
protected:
    virtual void listenForRequest() = 0;
    virtual void sendResponse() = 0;

    virtual bool isRequestPending();
    
    
    bool isServingData;
    
    MPI_Request request;
    MPI_Status status;
};

#endif
